﻿using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExcelHelper.ExcelModel
{
    public abstract class BaseExcelModel
    {
        [Npoi("视频ID")]
        public virtual int ViedoId { get; set; }
        [Npoi("年份")]
        public virtual int Year { get; set; }
        [Npoi("一级分类")]
        public virtual string Level1 { get; set; }
        [Npoi("二级分类")]
        public virtual string Level2 { get; set; }
        [Npoi("三级分类")]
        public virtual string Level3 { get; set; }
        [Npoi("课程名称")]
        public virtual string CourseName { get; set; }
        [Npoi("课程简介")]
        public virtual string CourseInfo { get; set; }
        [Npoi("章节名称")]
        public virtual string TitleName { get; set; }
        [Npoi("视频文件名（代码）")]
        public virtual string VideoCode { get; set; }
        [Npoi("课程图片")]
        public virtual string CoursePicture { get; set; }
        [Npoi("视频图片")]
        public virtual string VideoPicture { get; set; }
        [Npoi("关键字")]
        public virtual string KeyWords { get; set; }
       
        [Npoi("讲师")]
        public virtual string Teacher { get; set; }
        [Npoi("讲师简介")]
        public virtual string TeachInfo { get; set; }
        [Npoi("讲师图片")]
        public virtual string TeacherPicture { get; set; }
        [Npoi("时长")]
        public virtual string Duration { get; set; }
        [Npoi("视频大小")]
        public virtual string VideoSize { get; set; }
        [Npoi("显示比例")]
        public virtual string Display { get; set; }
        [Npoi("分辨率")]
        public virtual string Resolving { get; set; }
        [Npoi("合同号")]
        public virtual string Contract { get; set; }
        [Npoi("资源方")]
        public virtual string SourceFrom { get; set; }
        [Npoi("合同起始日")]
        public virtual DateTime ContractStartTime { get; set; }
        [Npoi("合同结束日")]
        public virtual DateTime ContractEndTime { get; set; }
        [Npoi("发布状态")]
        public virtual string IsPublish { get; set; }
        [Npoi("课程上线状态")]
        public virtual string IsOnline { get; set; }
        [Npoi("播放链接")]
        public virtual string PlayUrl { get; set; }
        //作者ID 虚字段，转换时用
        public virtual int AuthorID { get; set; }
        //目录ID，虚字段，转换时用
        public virtual int CatalogID { get; set; }
        //课程ID,需字段,转换时用
        public virtual int CourseID { get; set; }
    }
    public class GroupCataAndCourseModel
    {
        public string LevelMax { get; set; }
        public string CoursePicture { get; set; }
    }
    public class Compare : IEqualityComparer<GroupCataAndCourseModel>
    {

        public bool Equals(GroupCataAndCourseModel x, GroupCataAndCourseModel y)
        {
            if (x.LevelMax == y.LevelMax && x.CoursePicture == y.CoursePicture)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public int GetHashCode([DisallowNull] GroupCataAndCourseModel obj)
        {
            return obj.LevelMax.GetHashCode();
        }
    }
}
